<%@ page contentType="text/html;charset=UTF-8"%>
<%@ page import="jt.classic.system.user.IUser"%>
<%@ page import="jt.classic.system.object.IObject"%>
<%@ page import="jt.classic.system.workflow.WObject"%>
<%@ page import="org.limp.mine.annex.AnnexInfo"%>
<%@ page import="org.limp.mine.StringTool"%>
<%@ page import="org.limp.mine.DateTrimmer"%>
<%@ page import="java.util.List"%>
<%@ page import="java.util.Map"%>
<%
	String context = jt.classic.system.ISystem.getContextPath();
	IUser user = jt.classic.system.ISystem.getSessionUser(request);
	IObject obj = (IObject)request.getAttribute("object");
	WObject wobject = (WObject) request.getAttribute("wobject");
	String id = StringTool.checkString(request.getParameter("id"));
	String querykey = StringTool.checkString(request.getParameter("querykey"));
	List list = (List)obj.icontent(wobject.itable("APP_LFDTL"));
	String type = StringTool.checkString(request.getParameter("type"));
	
	Map lfInfo = (Map)((List)obj.icontent(wobject.itable("APP_LF"))).get(0);
	String lfbs = (String)lfInfo.get("LFBS");
	
	List list1 = (List)obj.icontent(wobject.itable("APP_XFHANDLER"));
	
	List list2 = (List)obj.icontent(wobject.itable("APP_XFFC"));
	
	List list3 = (List)obj.icontent(wobject.itable("APP_XFFH"));
	String g_groupName = "";
	if (list1 != null && !list1.isEmpty()) {
		for (int i = 0; i < list1.size(); i++) {
			Map info = (Map)list1.get(i);
			if(i ==0){
				g_groupName += info.get("H_GROUPNAME");
				
			}else{
				if((","+g_groupName+",").indexOf(","+info.get("H_GROUPNAME")+",")>-1){}
				else{
				   g_groupName += ","+info.get("H_GROUPNAME");
				}
			}
			
		
		}
	}
%>
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<TITLE>来访登记</TITLE>

<jsp:include page="../../system/object/initial4view.jsp"></jsp:include>

<link rel="stylesheet" type="text/css" href="<%=context%>/app/lf/css/xfstyle.css" />
<script src="<%=context %>/app/lf/js/xfinit.js"></script>

<script>
     function init(){
         initLfdjStyle();
         viewObject();
     }
</script>
</HEAD>
<BODY style="background-color:#fff;" onload="javascript:init();">
<form id="form1" name="form1" method="post"
	enctype="multipart/form-data" action=""><input type="hidden"
	name="lfid" value="" special="none"> <input type="hidden" name="DJRID"
	value="<%=user.id() %>"  special="none"> <input type="hidden" name="LXTYPE"
	value="<%=type %>"  special="none"> <input type="hidden" name="BLSTATUS"
	value="0"  special="none">
<div>&nbsp;</div>
<table width="800" class="tab4edit" border="1" cellspacing="0"
	cellpadding="0" align="center">
	
	<tr>
		<td colspan="4" class="tdtlt">
		<div align="center">来访案件基本信息</div>
		</td>
	</tr>
	<!-- <tr align="right" valign="middle" bgcolor="#FFFFFF">
		<td align="right" width="15%" valign="middle" class="td0">信访问题分类</td>
		<td align="left" width="35%">
		<input type="text" name="XFWTNAME" value="">
		</td>
		<td class="td0" width="15%">督办类型</td>
		<td align="left" width="35%"><input
			type="hidden" name="DBLXNAME" value=""></td>
	</tr> 
	<tr id="district1">
		<td align="right" valign="middle" class="td0">编号类型</td>
		<td align="left"><input
			type="hidden" name="BHLXNAME" value=""></td>
		<td align="right" class="td0">编&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;号</td>
		<td align="left">
		<input type="text" name="LFCODE" maxlength="32" value=""/></td>
	</tr>
  	<tr>
		<TD vAlign=center align=right class="td0">国家内容分类</TD>
		<TD align=left>
		<input type="text" name="GJNRNAME" id="GJNRNAME" value="" readonly="readonly">
		</TD>
		<td align="right" class="td0">性质分类</td>
		<td align="left">
		<input type="text" name="XZNAME" id="XZNAME" value="">
		</td>
	</tr>
-->
	<TR bgColor=#ffffff>
		<td align="right" valign="middle" class="td0">内容分类</td>
		<td align="left">
		<input type="text" name="NRNAME" id="NRNAME"  value="">
		</td>
		<td align="right" class="td0">信息来源</td>
		<td align="left">
		<input type="hidden" name="XXLYNAME" value=""></td>
	</TR>
	<tr>
		<td align="right" class="td0" style="display:none">是否区立案</td>
		<td align="left" style="display:none"><input type="radio" name="LA" value="0"
			  /> 是 <input type="radio" name="LA"
			value="1" checked="checked" /> 否</td>
		<td align="right" class="td0">处理情况 </td>
		<td align="left" > <input
			type="hidden" name="CLQKNAME" value=""></td>
	</tr>
	<tr  id="lianxinxi" > 
		<td align="right" valign="middle" class="td0">立案来源</td>
		<td align="left"><input type="hidden" name="LALYNAME" value=""></td>
		<td align="right" class="td0">立案编号</td>
		<td align="left"><input type="hidden" name="LAH" maxlength='30' readonly/> </td>
	</tr>
	<!-- <tr > 
			<td align="right"  class="td0">窗口处理形式 </td>				
				<td align="left" style="display:block ">
				<input type="hidden" name="CKCLXSNAME" value="">
				</td>
				<td align="right"  class="td0">处理情况 </td>
			<td align="left" style="display:block ">
				<input type="hidden" name="CLQKNAME" value="">
				
			</td>
     </tr> -->
	<tr align="right" valign="middle">

		<td align="right" class="td0">日常接待</td>
		<td align="left"><input type="radio" name="RCJD"
			value="0" checked="checked" onclick="richangjiedai(true)" />
		日常接待&nbsp; <input type="radio" name="RCJD" value="1"
			onclick="richangjiedai(false)" /> 领导接待日接待&nbsp;</td>

		<td class="td0">
		<div id="jdr1">接 待 人</div>
		</td>
		<td align="left" style="display:block ">
		<div id="jdr2"><input type="text" name="JDR" maxlength="16"
			size="16" value="" /></div>
		</td>

	</tr>
	<tr align="right" valign="middle">

		<td class="td0">是否越级访问</td>
		<td align="left"  colspan="3"><input type="radio" name="SFYJFW" value="0"
			checked="checked" /> 否 <input type="radio" name="SFYJFW"
			value="1" />
		到市信访办上访 <input type="radio" name="SFYJFW" value="2" /> 到市其他部门上访
		 <input type="radio" name="SFYJFW" value="3" /> 到国家信访办上访
		  <input type="radio" name="SFYJFW" value="4" /> 到中央其他部门上访</td>
		
	</tr>
	<tr align="right" valign="middle" bgcolor="#FFFFFF">
		<!-- <td width="150" align="right" class="td0">是否有效信</td>
		<td width="250" align="left"><input type="radio" name="VALID"
			value="1" checked="checked" /> 是 <input type="radio" name="VALID"
			value="0" /> 否</td> -->
		<td width="150" class="td0" align="right">督办类型</td>
		<td width="250" align="left"><input type="hidden" name="DBLXID" value=""
			special="wordbook" wbtype="xf_dblx" wbname="DBLXNAME"> <input
			type="hidden" name="DBLXNAME" value=""></td>
		<td class="td0">处理形式</td>
		<td align="left">
		<input type="hidden" name="CLXSNAME" value="">
		</td>
	</tr>
	<tr>
		<td height="40" align="right" valign="middle" class="td0">来访性质</td>
		<td align="left" colspan="3"><input type="checkbox" name="LFXZID_0" value="1" />正常&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		<input type="checkbox" name="LFXZID_1" value="1" />围堵&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
		<input type="checkbox" name="LFXZID_2" value="1" />滞留&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		<input type="checkbox" name="LFXZID_3" value="1" />闹事&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
		<input type="checkbox" name="LFXZID_4" value="1" />静坐&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		<input type="checkbox" name="LFXZID_5" value="1" />重要访&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
		<input type="checkbox" name="LFXZID_6" value="1" />强制&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
		<input type="checkbox" name="LFXZID_7" value="1" />越级&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		<input type="checkbox" name="LFXZID_8" value="1" />不稳定因素&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		<input type="checkbox" name="LFXZID_9" value="1" />包案后上访&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		<input type="checkbox" name="LFXZID_10" value="1" />未预报（20人以上）&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		</td>
	</tr>
<!-- 
	<tr align="right" valign="middle">
		<td class="td0">下访后上访</td>
		<td align="left"><input type="checkbox" name="XFHSSF" value="1" />
		</td>
		<td class="td0">包&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;案</td>
		<td align="left"><input type="checkbox" name="BA" value="1" /></td>
	</tr>
 -->
	<tr align="right" valign="middle">
	<!-- 	<td class="td0">结果已回复</td>
		<td align="left"><input type="checkbox" name="JGYHF" value="1" />
		</td> -->
		<td class="td0">身&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;份</td>
		<td align="left"  colspan="3"><input type="hidden" name="SFID" value=""
			special="wordbook" wbtype="xf_sf" wbname="SFNAME"> <input
			type="hidden" name="SFNAME" value=""></td>
	</tr>

	<tr align="right" valign="middle">
		<td class="td0">人&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;数</td>
		<td align="left"><input type="text" name="RS" value="1"
			onblur="javascript:addItem(this.value);" /> 人</td>
		<td class="td0">所 属 地</td>
		<td align="left">
		  <input type="text" name="SSDNAME" value="">
		  &nbsp;<input type="text" name="QT_SDNAME" value="">
		</td>
	</tr>
	<tr align="right" valign="middle">
		<!-- <td class="td0">是否重复反映</td>
		<td align="left"><input type="radio" name="SFCF" value="0"
			checked="checked" /> 首次反映 <input type="radio" name="SFCF"
			value="1" /> 重复反映</td> -->
		<td class="td0">被反映单位</td>
		<td align="left"  colspan="3"><input type="text" name="BFYDW"
			maxlength="50" value="" /></td>
	</tr>
	<tr align="right" valign="middle">
		<td class="td0">信访日期</td>
		<td align="left"><input  name="XFTIME"  type="hidden" special="date"/></td>
		<td class="td0">信息重要程度</td>
		<td align="left">
		<input type="hidden" name="ZYCDNAME" value=""> 
		</td>
	</tr>

	<tr align="right" valign="middle">
		<td class="td0">登 记 人</td>
		<td align="left" colspan="3">
		<input type="hidden" name="DJRNAME" value=""></td>
		
	</tr>

	<tr align="right" valign="middle">
		<td class="td0">内&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;容</td>
		<td colspan="3" align="left"><textarea name="NR" cols="80"
			rows="5"></textarea></td>
	</tr>
	<!-- 
	<tr align="right" valign="middle">
		<td class="td0">关 键 字</td>
		<td colspan="3" align="left"><input type="text" name="GJZ"
			maxlength="50" size="80" value="" /></td>
	</tr>
	<tr align="right" valign="middle">
		<td class="td0">处理方式</td>
		<td colspan="3" align="left"><textarea name="CLFS" cols="80" rows="3"></textarea> </td>
	</tr>
	 -->
	<tr align="right" valign="middle" id="lingdao1">
		<td align="right" valign="middle" class="td0">接待领导</td>
		<td align="left">
		<input type="text" name="JDLDNAME" value="">
		</td>
		<td class="td0">领导职务</td>
		<td align="left">
		<input type="hidden" name="LDZWNAME" value=""> 
		</td>
	</tr>
	<tr align="right" valign="middle" >
		<td class="td0">领导批示</td>
		<td colspan="3" align="left"><textarea name="LDPS" cols="80" rows="3"></textarea></td>
	</tr>

	<tr align="right" valign="middle">
		<td class="td0">领导批示件</td>
		<%if("1".equals(lfbs)){%>
			<td colspan="3" align="left"><textarea name="FJNR1" cols="80" rows="3"></textarea></td>
		<%}else{ %>
			<td colspan="3" align="left"><input type="file" name="LDPSJ" id="LDPSJ" /></td>
		<%} %>
	</tr>

	<tr align="right" valign="middle">
		<td class="td0">交 办 单</td>
		<%if("1".equals(lfbs)){%>
			<td colspan="3" align="left"><textarea name="FJNR2" cols="80" rows="3"></textarea></td>
		<%}else{ %>
			<td colspan="3" align="left"><input type="file" name="JBD" id="JBD"/></td>
		<%}%>
	</tr>
	<tr>
		<td colspan="4" class="tdtlt">
		<div align="center">来访人登记</div>
		</td>
	</tr>
	<tr>
		<td colspan="4" class="nopadding">
		<table border="1" id="lxr" class="tab-noborder" width="100%" cellspacing="0"
			cellpadding="0">
			<tr>
				<td class="td0" style="border:0px;">信访人姓名</td>
				<td class="td0" style="border:0px;">性别</td>
				<td class="td0" style="border:0px;">年龄</td>
				<td class="td0" style="border:0px;">身份证号</td>
				<td class="td0" style="border:0px;">联系电话</td>
				<td class="td0" style="border:0px;">邮政编码</td>
				<td class="td0" style="border:0px;">单位或地址</td>
			</tr>
			<%
					if (list != null && !list.isEmpty()) {
					for (int i = 0; i < list.size(); i++) {
						
			%>
			<tr>
				<td style="border:0px;"><input type="hidden"
					name="lxdtid_<%=i %>" id="lxdtid_<%=i %>" special="none"/> <input
					type="hidden" name="lxid_<%=i %>" id="lxid_<%=i %>" special="none" /><input
					type="text" name="XF_USERNAME_<%=i %>" id="XF_USERNAME_<%=i %>" /></td>
				<td style="border:0px;"><select name="XF_USERSEX_<%=i %>"
					id="XF_USERSEX_<%=i %>">
					<option value="1">男</option>
					<option value="0">女</option>
				</select></td>
				<td style="border:0px;"><input type="text"
					name="XF_USERAGE_<%=i %>" id="XF_USERAGE_<%=i %>" /></td>
				<td style="border:0px;"><input type="text"
					name="XF_USERLICENSE_<%=i %>" id="XF_USERLICENSE_<%=i %>" /></td>
				<td style="border:0px;"><input type="text"
					name="XF_USERTEL_<%=i %>" id="XF_USERTEL_<%=i %>" /></td>
				<td style="border:0px;"><input type="text"
					name="XF_USERCODE_<%=i %>" id="XF_USERCODE_<%=i %>" /></td>
				<td style="border:0px;"><input type="text"
					name="XF_USERADDRESS_<%=i %>" id="XF_USERADDRESS_<%=i %>" /></td>
			</tr>
			<%
				}
				}
			%>
		</table>
		</td>
	</tr>
</table>


		<%
		if (list1 != null && !list1.isEmpty()) {
				for (int i = 0; i < list1.size(); i++) {
					Map info = (Map)list1.get(i);
					
					String hdlstatus = (String)info.get("H_STATUS");
					AnnexInfo[] ais = (AnnexInfo[])info.get("HFFJ");
					AnnexInfo ai = (ais != null ? ais[0] : null);
					if(hdlstatus.equals("1")){
		%>
		<table border="1" class="tab-noborder" style="margin-top:5px;" width="800" cellspacing="0" cellpadding="0" align="center">		
		<tr>
			<td style="border:0px;" colspan="2"><b>办理人：</b><%=info.get("H_USERNAME") %>，<b>所在科室：</b><%=info.get("H_GROUPNAME") %>，<b>办理时间：</b><%=DateTrimmer.getYMD_LBL((String)info.get("H_DATE")) %></td>
		</tr>
		<tr>
			<td style="border:0px;" width="10%" valign="top"><b>回复内容：<b></td>
			<td style="border:0px;" align="left"><%=info.get("H_BACKINFO") %></td>
		</tr>
		<%if(ai != null){ %>
		<tr>
			<td style="border:0px;" width="10%" valign="top"><b>附件：<b></td>
			<td style="border:0px;" align="left"><a href="javascript:void(0);" onclick="javascript:viewAnnex('<%=ai.getID()%>');" title="查看附件"><%=ai.getName()%></a></td>
		</tr>
		<%} %>
		</table>
		<%
			  
					}
				}	
			}
		%>
		
<%
if (list2 != null && !list2.isEmpty()) {
		for (int i = 0; i < list2.size(); i++) {
			Map info = (Map)list2.get(i);
			
			String hdlstatus = (String)info.get("FC_STATUS");
			if(hdlstatus.equals("1")){
				AnnexInfo[] ais = (AnnexInfo[])info.get("FC_FILE");
				AnnexInfo ai = (ais != null ? ais[0] : null);
%>
<table border="1" class="tab-noborder" style="margin-top:5px;" width="800" cellspacing="0" cellpadding="0" align="center">		
<tr>
	<td style="border:0px;" colspan="2"><b>复查办理人：</b><%=info.get("FC_USERNAME") %>，<b>科室：</b><%=info.get("FC_GROUPNAME") %>，<b>复查办理时间：</b><%=DateTrimmer.getYMD_LBL((String)info.get("FC_BLDATE")) %></td>
</tr>
<tr>
	<td style="border:0px;" width="15%" valign="top"><b>复查办理内容：<b></td>
	<td style="border:0px;" align="left"><%=info.get("FC_BACKINFO") %></td>
</tr>
<%if(ai != null){ %>
<tr>
	<td style="border:0px;" width="15%" valign="top"><b>附件：<b></td>
	<td style="border:0px;" align="left"><a href="javascript:void(0);" onclick="javascript:viewAnnex('<%=ai.getID()%>');" title="查看附件"><%=ai.getName()%></a></td>
</tr>
<%} %>
</table>
<%
	  
			}
		}	
	}
%>

<%
if (list3 != null && !list3.isEmpty()) {
		for (int i = 0; i < list3.size(); i++) {
			Map info = (Map)list3.get(i);
			
			String hdlstatus = (String)info.get("FH_STATUS");
			if(hdlstatus.equals("1")){
				AnnexInfo[] ais = (AnnexInfo[])info.get("FH_FILE");
				AnnexInfo ai = (ais != null ? ais[0] : null);
%>
<table border="1" class="tab-noborder" style="margin-top:5px;" width="800" cellspacing="0" cellpadding="0" align="center">		
<tr>
	<td style="border:0px;" colspan="2"><b>复核办理人：</b><%=info.get("FH_USERNAME") %>，<b>科室：</b><%=info.get("FH_GROUPNAME") %>，<b>复核办理时间：</b><%=DateTrimmer.getYMD_LBL((String)info.get("FH_BLDATE")) %></td>
</tr>
<tr>
	<td style="border:0px;" width="15%" valign="top"><b>复核办理内容：<b></td>
	<td style="border:0px;" align="left"><%=info.get("FH_BACKINFO") %></td>
</tr>
<%if(ai != null){ %>
<tr>
	<td style="border:0px;" width="15%" valign="top"><b>附件：<b></td>
	<td style="border:0px;" align="left"><a href="javascript:void(0);" onclick="javascript:viewAnnex('<%=ai.getID()%>');" title="查看附件"><%=ai.getName()%></a></td>
</tr>
<%} %>
</table>
<%
	  
			}
		}	
	}
%>

</form>

<script>
	<%
         if(type.equals("1")){
     %>
     var district1 = document.getElementById('district1');
     district1.style.display="none";
     var BHLXID = document.getElementById('BHLXID');
		BHLXID.setAttribute("colneed", "0");
     <%
         }
     %>
	var lianxinxi = document.getElementById('lianxinxi');
	lianxinxi.style.display="none";
     

</script>
</BODY>
</HTML>
